/*
 * @Author: 夏郑兴 971348024@qq.com
 * @Date: 2022-11-17 19:24:36
 * @LastEditors: 夏郑兴 971348024@qq.com
 * @LastEditTime: 2023-03-01 14:52:37
 * @FilePath: /szls-gitee-project/Users/xzx/Desktop/szls/starter-3/nuxt.config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// https://v3.nuxtjs.org/api/configuration/nuxt.config https://nuxt.com.cn/docs/api/nuxt-config
// https://nuxt.com/templates 模板框架
export default defineNuxtConfig({
	app: {
		head: {
			charset: 'utf-8',
			viewport: 'width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0',
			title: 'Nuxt3 模板',
			meta: [
				// <meta name="description" content="My amazing site">
				{ name: 'description', content: 'My amazing site.' }
			],
		},
	},
	// 原来buildModules正式版本改modules
	modules: [
		'nuxt-windicss',
	],
    plugins: [
		// 引入富文本插件wangEditor
		{
		  src: '~/plugins/wang-editor',
		  mode: 'client',
		}
    ],

	css: ['element-plus/dist/index.css'],
	build: {
		transpile:
			process.env.NODE_ENV === 'production'
				? [
					'naive-ui',
					'vueuc',
					'@css-render/vue3-ssr',
					'@juggle/resize-observer'
				]
				: ['@juggle/resize-observer']
	},
	vite: {
		optimizeDeps: {
			include:
				process.env.NODE_ENV === 'development'
					? ['naive-ui', 'vueuc', 'date-fns-tz/esm/formatInTimeZone']
					: []
		}
	},
	// buildDir: 'nuxt-build',
	runtimeConfig: {
	    // Keys within public, will be also exposed to the client-side
		// 生产环境的下线api前缀
	    public: {
	      apiBase: 'http://192.168.0.110:8080'
	    }
	},
	nitro: {
		devProxy: {
			"/jeecg-boot": {
				target: 'http://192.168.0.110:8080',
				prependPath: true,
				changeOrigin: true,
				pathRewrite: {
					'^/jeecg-boot': '/jeecg-boot'
				},
			}
		}
	}
})